<template>
    <tr>
        <td><input type="checkbox" v-model="obj.checked"></td>
        <td>{{obj.name}}</td>
        <td>{{obj.price}}</td>
        <td><button @click="jFn">-</button>{{obj.num}}<button @click="addFn">+</button></td>
        <td>{{obj.price * obj.num}}</td>
        <td><button @click="delFn">删除</button></td>
    </tr>
</template>

<script>
export default {
    props:['index','obj'],
    methods: {
        addFn() {
            this.$emit("addbtn", this.index, this.obj.num);
        },
        jFn() {
            this.$emit('jbtn', this.index, this.obj.num)
        },
        delFn(){
            this.$emit('delbtn',this.index)
        }
    }
}
</script>

<style>

</style>